package com.oracle.service.impl;


import javax.annotation.Resource;

import com.oracle.dao.SysAuthorityDao;
import com.oracle.dao.UserDao;
import com.oracle.pojo.SysAuthority;
import com.oracle.pojo.SysUser;
import com.oracle.service.UserService;
import org.apache.shiro.crypto.hash.SimpleHash;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


/**
 * 
* @ClassName: UserServiceImpl 
* @Description: TODO(这里用一句话描述这个类的作用) 
* @author Jencks 
* @date 2017年4月26日 下午1:31:09 
*
 */
@Service("userService")
public class UserServiceImpl implements UserService {

    @Resource
    private UserDao userDao;
    @Autowired
	private SysAuthorityDao sysAuthorityDao;

    @Override
    public SysUser findUserByUsername(String userName) {
        return userDao.findUserByUsername(userName);
    }
	@Override
	public List<SysAuthority> getPermissions(Integer id) {
		return sysAuthorityDao.getPermissionsByUserId(id);
	}
	@Override
    public Integer saveUser(String phone, String passWord, String smsCode){
        return userDao.saveUser(phone,passWord,smsCode);
    }

}
